diff --git a/django/views/generic/base.py b/django/views/generic/base.py
index ea5baca08d..db1103e25b 100644
--- a/django/views/generic/base.py
+++ b/django/views/generic/base.py
@@ -163,6 +163,15 @@ class TemplateView(TemplateResponseMixin, ContextMixin, View):
         context = self.get_context_data(**context_kwargs)
         return self.render_to_response(context)
 
+    def get_context_data(self, **kwargs):
+        kwargs.setdefault('view', self)
+        if self.extra_context is not None:
+            kwargs.update(self.extra_context)
+        for key, value in kwargs.items():
+            if isinstance(value, SimpleLazyObject):
+                kwargs[key] = str(value)
+        return kwargs
+
 
 # RemovedInDjango40Warning
 def _wrap_url_kwargs_with_deprecation_warning(url_kwargs):
